domain = format->domain;
else
domain = GETTEXT_PACKAGE;
- description = dgettext (domain, format->description);
+ description = g_dgettext (domain, format->description);
return g_strdup (description);
}
{
g_set_error (error, GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
- ngettext("failed to allocate image buffer of %u byte",
- "failed to allocate image buffer of %u bytes",
- pixdata->rowstride * pixdata->height),
+ g_dngettext(GETTEXT_PACKAGE,
+ "failed to allocate image buffer of %u byte",
+ "failed to allocate image buffer of %u bytes",
+ pixdata->rowstride * pixdata->height),
pixdata->rowstride * pixdata->height);
return NULL;
}
else if (files_count == 1)
description = g_strdup_printf (_("Opening %s"), get_display_name (files->data));
else
- description = g_strdup_printf (dngettext (GETTEXT_PACKAGE,
- "Opening %d Item",
- "Opening %d Items",
- files_count), files_count);
+ description = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE,
+ "Opening %d Item",
+ "Opening %d Items",
+ files_count), files_count);
icon_name = NULL;
if (priv->icon_name)
element_name);
}
-/* This function is taken from gettext.h
- * GNU gettext uses '\004' to separate context and msgid in .mo files.
- */
-static const char *
-_dpgettext (const char *domain,
- const char *msgctxt,
- const char *msgid)
-{
- size_t msgctxt_len = strlen (msgctxt) + 1;
- size_t msgid_len = strlen (msgid) + 1;
- const char *translation;
- char* msg_ctxt_id;
-
- msg_ctxt_id = g_alloca (msgctxt_len + msgid_len);
-
- memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
- msg_ctxt_id[msgctxt_len - 1] = '\004';
- memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
-
- translation = g_dgettext (domain, msg_ctxt_id);
-
- if (translation == msg_ctxt_id)
- {
- /* try the old way of doing message contexts, too */
- msg_ctxt_id[msgctxt_len - 1] = '|';
- translation = g_dgettext (domain, msg_ctxt_id);
-
- if (translation == msg_ctxt_id)
- return msgid;
- }
-
- return translation;
-}
-
gchar *
_gtk_builder_parser_translate (const gchar *domain,
const gchar *context,
const char *s;
if (context)
- s = _dpgettext (domain, context, text);
+ s = g_dpgettext2 (domain, context, text);
else
s = g_dgettext (domain, text);
$(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES)
$(XGETTEXT) --default-domain=$(GETTEXT_PACKAGE) --directory=$(top_srcdir) \
--add-comments --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 \
+ --keyword=g_dngettext:2,3 \
+ --flag=g_dngettext:2:pass-c-format \
--flag=g_strdup_printf:1:c-format \
--flag=g_string_printf:2:c-format \
--flag=g_string_append_printf:2:c-format \